package com.mvvm.api.user;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.alibaba.dubbo.config.annotation.Reference;
import com.mvvm.service.user.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.mvvm.model.User.User;
/**
 * 
 * @author fy
 *
 */
@Controller
public class UserController {

	@Reference
	UserInfoService userInfoService;
//	@Autowired
//	private MongoTemplate mongoTemplate;

	@RequestMapping(value="/getUid",method=RequestMethod.GET)
	@CrossOrigin
	public @ResponseBody List<String> userController(HttpServletRequest request) {
		User user=new User();
//		List<Department> users=new ArrayList<Department>();
//		users=userDao.getUserId();
		user.setUname("78922");
		userInfoService.save(user);
//		userService.eeUserService();
//		user.setUid(2);
//		user.setUname("fengyuan");
//		mongoTemplate.save(user);
//		List<User> unames=mongoTemplate.findAll(User.class);
//		System.out.println(unames.get(0).getUid());
		return  null;
	}
	
//	@ApiOperation(value="获取所有用户",notes="获取所有用户")
//	@RequestMapping(value="/getUsers/{id}",method=RequestMethod.GET)
//	@ApiImplicitParam(name="id",value="角色Id",required=true,dataType="String")
//	public @ResponseBody String getUsers(@PathVariable String id) {
//		return "fengyuann";
//	}
}
